package com.xbongbong.formula.qlexpress.operator.advanced;

import com.ql.util.express.Operator;

import java.util.UUID;


/**
 * UUID函数随机码生成器。可适用于随机流水号的使用场景等
 * @author 吴峰
 * @version v1.0
 * @date 2020/1/8 9:32
 * @since v1.0
 */
public class OperatorUuid extends Operator {

    public OperatorUuid(String name){
        this.name = name;
    }

    public OperatorUuid(String aAliasName, String aName, String errorInfo){
        this.aliasName = aAliasName;
        this.name = aName;
        this.errorInfo = errorInfo;
    }

    /**
     * 语法：UUID函数随机码生成器。可适用于随机流水号的使用场景等
     * @param list
     * @return
     * @throws Exception
     */
    @Override
    public Object executeInner(Object[] list) throws Exception {
        return UUID.randomUUID().toString();
    }
}
